<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>金融资产流转管理</title>
    <link rel="stylesheet" href="../../js/bower_components/bootstrap/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="../../js/bower_components/bootstrap-select/dist/css/bootstrap-select.min.css">
    <link rel="stylesheet" href="../../js/bower_components/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css">
    <link rel="stylesheet" href="../../js/bower_components/bootstrap-table/dist/bootstrap-table.min.css">
    <link rel="stylesheet" href="../../js/bower_components/bootstrap-treeview/dist/bootstrap-treeview.min.css">

    <script src="../../js/bower_components/jquery/dist/jquery.min.js"></script>
    <script src="../../js/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
    <script src="../../js/bower_components/bootbox.min.js"></script>
    <script src="../../js/bower_components/bootstrap-select/js/bootstrap-select.js"></script>
    <script src="../../js/bower_components/bootstrap-switch/dist/js/bootstrap-switch.min.js"></script>
    <script src="../../js/bower_components/bootstrap-table/dist/bootstrap-table.min.js"></script>
    <script src="../../js/bower_components/bootstrap-table/dist/locale/bootstrap-table-zh-CN.js"></script>
    <script src="../../js/bower_components/bootstrap-treeview/dist/bootstrap-treeview.min.js"></script>
    <script src="../../js/bower_components/jquery-form-validator/form-validator/jquery.form-validator.min.js"></script>
    <script src="../../js/bower_components/moment/min/moment-with-locales.min.js"></script>
    <script>
        $(function(){
            checkinList();
            checkoutList();
            
            $("#btnAdd").click(function(){
                console.log("模态框打开方法===1");
                $('#divForm').modal();
                console.log("模态框打开方法===2");
			});
            $("#btnScal").click(function(){
                console.log("模态框打开方法===1");
                $('#divForm').modal();
                console.log("模态框打开方法===2");
			});
        })


        function checkinList(){
            $("#tblCheckoutResult").bootstrapTable("destroy");
            $("#tblCheckoutResult").bootstrapTable({
                loadMsg: "正在加载数据....",
                url: "http://121.37.241.58:8883/logic/trans/normal/checkin/list",
                sidePagination: 'client',
                pageSize: "5",
                Pageinatin: true,
                idField: "id",
                columns:[{field: "assetsnamecn",
                    title: "<span class='glyphicon glyphicon-tags' /> 资产名称",
                    halign: 'center'
                },{field: "assetscode",
                    title: "资产编号",
                    halign: 'center'
                },{field: "price",
                    title: "单价",
                    halign: 'center'
                },{field: "currentamount",
                    title: "库存余量",
                    halign: 'center'
                },{field: "handlerempname",
                   title: "采购人",
                   halign: "center"
                },{field: "instocktime",
                   title: "入库时间",
                   halign: "center"
                },{field: "id",
                   title: "领用操作",
                   halign: "center"
                }]
            })
        }
        function checkoutList(){
            $("#tblShiftResult").bootstrapTable("destroy");
            $("#tblShiftResult").bootstrapTable({
                loadMsg: "正在加载数据....",
                url: "http://121.37.241.58:8883/logic/trans/car/checkout/list",
                sidePagination: 'client',
                pageSize: "5",
                Pageinatin: true,
                idField: "id",
                columns:[{field: "assetsnamecn",
                    title: "<span class='glyphicon glyphicon-tags'/> 资产名称",
                    halign: 'center'
                },{field: "assetscode",
                    title: "资产编号",
                    halign: 'center'
                },{field: "price",
                    title: "单价",
                    halign: 'center'
                },{field: "currentamount",
                    title: "持有数量",
                    halign: 'center'
                },{field: "targetempname",
                   title: "当前持有人",
                   halign: "center"
                },{field: "instocktime",
                   title: "领用时间",
                   halign: "center"
                },{text: "<button>记录</button>",
                   title: "转移操作",
                   halign: "center"
                }]
            })
        }
   </script>
</head>
<body>
    <div class="container-fluid">
        <!-- 查询界面 -->
        <div class="row">
            <div id="SearchForm" class="form-inline">
                <div class="input-group">
                    <label for="selTransType">资产操作：</label>
                    <select id="selTransType">
                        <option value="2" selected="selected">资产领用</option>
                        <option value="4">资产转移</option>
                    </select>
                </div>
                <div class="input-group">
                    <label for="tbxAssetsName">资产名称：</label>
                    <input type="text" id="tbxAssetsName">
                </div>
                <div class="input-group">
                    <label for="tbxBatchNo">批次编号：</label>
                    <input type="text" id="tbxBatchNo">
                </div>
                <div class="input-group">
                    <button type="button" id="btnSearch" class="btn-primary">
                        <span class="glyphicon glyphicon-search">检索 Search</span>
                    </button>
                </div>
            </div>
        </div>
        <!-- 显示界面 -->
        <div class="row" id="checkOutList">
            <div class="col-md-10">
                <h4>可领用资产列表：</h4>
                <button id="btnAdd">领用</button>
                <br>
                <div id="divCheckoutResult">
                    <table id="tblCheckoutResult">
                        <!-- <thead>
                                <th> <span class="glyphicon glyphicon-tags">资产编号</span></th>  
                        </thead> -->
                    </table>
                </div>
            </div>
        </div>
        <div class="row" id="shiftList">
            <div class="col-md-10">
                <h4>可转移资产列表：</h4>
                <button id="btnScal">转移</button>
                <br>
                <div id="divShiftResult">
                    <table id="tblShiftResult">
                        <!-- <thead>
                            <tr>
                                <th><span class="glyphicon glyphicon-tags"></span></th>
                            </tr>
                        </thead> -->
                    </table>
                </div>
            </div>
        </div>
        <!-- 资产领用、转移表单 -->
        <div class="modal fade" id="divForm" tabindex="-1" role="dialog" aria-labelledby="myModal" aria-hidden="false">
            <div class="modal-dialog">
                <div id="content" class="modal-content">
                    <div id="transHistoryHead" class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title" id="transHistoryTitle">
                            <span class="glyphicon glyphicon-equalizer">资产流转</span>
                            <span id="sapnTransType"></span>
                        </h4>
                    </div>
                    <div class="modal-body">
                        <form id="formAssetsTrans">
                            <div id="divTransAlert" role="alert"></div>
                            <div id="divTransContent" class="form-inline" style="text-align: center;">
                                <div>
                                    <label for="tbxAssetsInfo">资产信息：</label>
                                    <div class="input-group">
                                        <input type="text" id="tbxAssetsInfo" readonly="readonly">
                                        <span class="input-group-addon">
                                            <span class="glyphicon glyphicon-asterisk"></span>
                                        </span>
                                    </div>
                                </div>
                                <div>
                                    <label for="tbxCount">操作数量：</label>
                                    <div class="input-group">
                                        <input type="number" id="tbxCount" required="required">
                                        <span class="input-group-addon">
                                            <span class="glyphicon glyphicon-asterisk"></span>
                                        </span>
                                    </div>
                                </div>
                                <div>
                                    <label for="tbxPrice">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;单价：</label>
                                    <div class="input-group">
                                        <input type="text" id="tbxPrice" readonly="readonly">
                                        <span class="input-group-addon">
                                            <span class="glyphicon glyphicon-asterisk"></span>
                                        </span>
                                    </div>
                                </div>
                                <div>
                                    <label for="tbxTotalPrice">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;合计总价：</label>
                                    <div class="input-group">
                                        <span class="input-group-addon">￥</span>
                                        <input type="text" id="tbxPrice" readonly="readonly">
                                        <span class="input-group-addon">
                                            <span class="glyphicon glyphicon-asterisk"></span>
                                        </span>
                                    </div>
                                </div>
                                <div>
                                    <label for="tbxTransDate">操作时间：</label>
                                    <div class="input-group">
                                        <input type="date" id="tbxTransDate" required="required">
                                        <span class="input-group-addon">
                                            <span class="glyphicon glyphicon-asterisk"></span>
                                        </span>
                                    </div>
                                </div>
                                <div id="divHandlerEmp">
                                    <label for="tbxHandlerEmp">当前持有人：</label>
                                    <div class="input-group">
                                        <input type="text" id="tbxHandlerEmp" readonly="readonly">
                                        <span class="input-group-addon">
                                            <span class="glyphicon glyphicon-asterisk"></span>
                                        </span>
                                    </div>
                                </div>
                                <div>
                                    <label for="selTargetEmp">领用人：</label>
                                    <div class="input-group">
                                        <input type="text" id="selTargetEmp" readonly="readonly">
                                        <span class="input-group-addon">
                                            <span class="glyphicon glyphicon-asterisk"></span>
                                        </span>
                                    </div>
                                </div>
                                <div>
                                    <label for="tbxTransComment">备注说明：</label>
                                    <div class="input-group">
                                        <textarea rows="2" id="tbxTransComment"></textarea>
                                        <span class="input-group-addon">
                                            <span class="glyphicon glyphicon-asterisk"></span>
                                        </span>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="modal-footer">
                        <button class="btn-primary" id="btnCheckout">
                            <span class="glyphicon glyphicon-share">出库</span>
                        </button>
                        <button class="btn-primary" id="btnShift">
                            <span class="glyphicon glyphicon-retweet">转移</span>
                        </button>
                        <button class="btn-default" data-dismiss="modal" id="btnCancelInstock">
                            <span class="glyphicon glyphicon-remove">取消</span>
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>